package com.zzt.mylotterykill.data;

import com.zzt.mylotterykill.entity.Option;
import com.zzt.mylotterykill.enums.GameEnum;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class OptionData {
    private static Map<GameEnum, List<List<Option>>> optionMap = new HashMap<>();

    public static List<List<Option>> getOptionList(GameEnum gameEnum) {
        return optionMap.get(gameEnum);
    }

    static {
        //初始化六合彩的投注选项
        List<List<Option>> optionSetLhc = new ArrayList<>();
        List<Option> optionLhc = Option.getLhcOptions();
        List<Option> optionListLhcZmS = optionLhc.stream().filter(e -> e.getOption().getName().contains("zmsame")).collect(Collectors.toList());
        List<Option> optionListLhcTmS = optionLhc.stream().filter(e -> e.getOption().getName().equals("tmsame")).collect(Collectors.toList());
        List<Option> optionListLhcZmDxds = optionLhc.stream().filter(e -> e.getOption().getName().contains("zmdxds")).collect(Collectors.toList());
        List<Option> optionListLhcTmDxds = optionLhc.stream().filter(e -> e.getOption().getName().equals("tmdxds")).collect(Collectors.toList());
        optionSetLhc.add(optionListLhcZmS);
        optionSetLhc.add(optionListLhcTmS);
        optionSetLhc.add(optionListLhcZmDxds);
        optionSetLhc.add(optionListLhcTmDxds);
        optionMap.put(GameEnum.LHC, optionSetLhc);
    }
}
